package tryonce.entry;

import java.util.Objects;

public class Store implements Comparable<Store>{
    private Integer id;//商品编号
    private String name;//商品名称
    private Double price;//商品价格
    private String color;//商品颜色
    private Integer size;//商品尺寸
    private Integer num;//商品库存数量

    public Store() {
    }

    public Store(Integer id, String name, Double price, String color, Integer size, Integer num) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.color = color;
        this.size = size;
        this.num = num;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Store store = (Store) o;
        return Objects.equals(id, store.id) && Objects.equals(name, store.name) && Objects.equals(price, store.price) && Objects.equals(color, store.color) && Objects.equals(size, store.size) && Objects.equals(num, store.num);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, price, color, size, num);
    }

    @Override
    public int compareTo(Store o) {
        return this.id.compareTo(o.id);
    }
}
